<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<style>
<!--
.searchContent td label{
width:50px;
}
-->
</style>
<%--dwz分页查询 隐藏传值表单  begin --%>
<form id="pagerForm" method="post" action="#rel#">
	<input type="hidden" name="pageNum" value="${currentPage }" /> 
	<input type="hidden" name="numPerPage" value="${numPerPage}" /> 
	<input type="hidden" name="orderField" value="${param.orderField}" /> 
	<input type="hidden" name="orderDirection" value="${param.orderDirection}" />
</form>
<%--dwz分页查询 隐藏传值表单  end --%>
<%--页头 检索条件区域 begin --%>
<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return navTabSearch(this);"	action="outsideUser_list.action" method="post">
	<div class="searchBar nowrap">
		<p>
			<label>姓名或手机号:</label>
			<input type="text" name="osuName" value="${osuName}" maxlength="20"/>
		</p>
		<p>
			<label>用户类型：</label>
			<select name="osuType" 
				class="combox">
				<option value="-1">---请选择---</option>
				<option ${osuType==0?"selected":"" } value="0">学校管理员</option>
				<option ${osuType==1?"selected":"" } value="1">移动客户经理</option>
				<option ${osuType==2?"selected":"" } value="2">行业经理</option>
			</select>
		</p>
		<p>
			<label>所属地区：</label>
			<select name="areaCode" 
					class="combox required" ref="area_child_for_outUser" refUrl="school_getAreaByCity.action?areaCode={value}">
					<option value="">---所有地区---</option>
					<c:forEach items="${application.areaList}" var="area">
						<option ${areaCode==area.areaCode?"selected":""}  value="${area.areaCode }">${area.areaName}</option>
					</c:forEach>
			</select>
		</p>
			<p>
			<label>所属县区：</label>
			<select name="areaChildcode" 
					class="combox" id="area_child_for_outUser">
					<option value="">---请选择---</option>
					<c:forEach items="${countyList}" var="areaChild">
						<option ${areaChildcode==areaChild.areaCode?"selected":""}  value="${areaChild.areaCode }">${areaChild.areaName}</option>
					</c:forEach></select>
		</p>
		<div class="subBar">
			<ul>
				<li>
				<div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div>
				</li>
			</ul>
		</div>
	</div>
		<!-- 
		<div class="searchBar">
			<table class="searchContent" >
				<tr>
					<td>
						<label>姓&nbsp;&nbsp;名:</label>
						<input type="text" name="osuName" value="${osuName}" maxlength="20"/>
					</td>
					<td>
						<label>用户类型：</label>
						<select name="osuType" 
							class="required combox">
							<option value="-1">---请选择---</option>
							<option ${osuType==0?"selected":"" } value="0">学校管理员</option>
							<option ${osuType==1?"selected":"" } value="1">移动客户经理</option>
						</select>
					</td>
					<td><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></td>
				</tr>
			</table>
		</div>
		 -->
	</form>
</div>
<%--页头 检索条件区域 end --%>

<%--内容展示区域 begin --%>
<div class="pageContent">
	<%-- 工具栏  begin --%>
	<div class="panelBar">
		<c:choose>
			<c:when test="${empty errorMsg}">
				<ul class="toolBar">
					<li><a class="add" href="outsideUser_addUI.action" rel="outsideUser_addUI"  target="navTab" title="新增外部用户" ><span>新增</span></a></li>
					<li class="line">line</li>
					<li><a class="edit" href="outsideUser_editUI.action?osuId={user_id}" rel="outsideUser_editUI"  target="navTab" warn="请选择一个用户" title="修改外部用户"><span>修改</span>	</a></li>
					<li class="line">line</li>
					<li><a class="delete" href="outsideUser_delete.action?osuId={user_id}"  target="ajaxTodo"   title="确实要删除这些记录吗?">	<span>删除</span></a></li>
					<li class="line">line</li>
					<li><a class="look" href="outsideUser_show.action?osuId={user_id}" rel="outsideUser_show"  target="navTab" warn="请选择一个用户" title="查看外部用户"><span>查看</span>	</a></li>
					<li class="line">line</li>
					<li><a id="outsideUser_setFlagLink" class="icon" href="outsideUser_updateFlag.action?osuId={user_id}" target="ajaxTodo" title="确实要停用/启用该外部用户吗?"><span id="outsideUser_setFlagText">停用/启用</span></a></li>
					<li class="line">line</li>
					<li><a class="edit" href="outsideUser_resetPwd.action?osuId={user_id}"   target="ajaxTodo"  title="确定要重置该用户密码吗？"><span>密码重置</span>	</a></li>
					<li class="line">line</li>
				</ul>
			</c:when>
			<c:otherwise>
				<div style="line-height: 25px;margin-right: 20px;font-weight: normal;text-align: center;color: red;">
					${errorMsg }
				</div>
			</c:otherwise>
		</c:choose>
		
	</div>
	<%-- 工具栏 end  --%>
	<c:if test="${empty errorMsg }">
	<%-- 分页table列表 begin --%>
	<table class="table" width="100%" layoutH="118">
		<thead>
			<tr>
				<th align="center">序号</th>
				<th>地区</th>
				<th>区县</th>
				<th>姓名</th>
				<th>性别</th>
				<th>手机号</th>
				<th>邮箱</th>
				<th>用户类型</th>
				<th width="" >状态</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${recordList}" var="user" varStatus="status">
			<tr target="user_id" rel="${user.osuId }" onclick="outsideUser_doSelect(this)">
				<td>${(status.index+1) + (currentPage-1) * numPerPage}
					<input id="outsideUser_flag_${status.index }" type="hidden" value="${user.osuStatusFlag }">
				</td>
				<td>${application.areaMap[user.areaCode] }</td>
				<td>${application.areaMap[user.areaChildcode] }</td>
				<td>${user.osuName }</td>
				<td>
				<c:choose>
					<c:when test="${user.osuSex==1 }">
					男
					</c:when>
					<c:when test="${user.osuSex==2 }">
					女
					</c:when>
					<c:otherwise>
					未知
					</c:otherwise>
				</c:choose>
				</td>
				<td>${user.osuPhone }</td>
				<td>${user.osuEmail }</td>
				<td>
					${user.osuType==0?"学校管理员":"移动客户经理" }
				</td>
				<td>
					<a style="color:${user.osuStatusFlag==1?"green":"red"};text-decoration:none ;" >
						${user.osuStatusFlag==1?"正常":"停用" }
					</a>
				</td>
				<!-- 
				<td>
					<a style="cursor:pointer;color:${user.osuStatusFlag==1?"green":"red"};" 
						title="点击${user.osuStatusFlag==1?"停用":"启用" }"
						target="ajaxTodo"
						href="outsideUser_updateFlag.action?osuId=${user.osuId}"
						>
						${user.osuStatusFlag==1?"正常":"停用" }
					</a>
				</td>
				 -->
			</tr>
			</c:forEach>
		</tbody>
	</table>
	<%-- 分页table列表 end --%>
	
	<%--分页信息区 begin--%>
	<%@ include file="/WEB-INF/jsp/public/panelBar.jsp"%>	
	<%--分页信息区 end--%>
	</c:if>
</div>
<%--内容展示区域 end --%>
<script type="text/javascript">
function outsideUser_doSelect(obj){
	var flagText = $("#outsideUser_setFlagText", navTab.getCurrentPanel());
	var flagLink = $("#outsideUser_setFlagLink", navTab.getCurrentPanel());
	var falgValue = $("#outsideUser_flag_"+obj.rowIndex, navTab.getCurrentPanel()).val();
	if(falgValue==0){
		flagText.text("启用");
		flagLink.attr("title","确定要启用该外部用户吗？")
		flagLink.attr("class","icon-ok");
	}else if(falgValue==1){
		flagText.text("停用");
		flagLink.attr("title","确定要停用该外部用户吗？")
		flagLink.attr("class","icon");
	}else{
		flagText.text("停用/启用");
		flagLink.attr("class","icon");
	}
}
</script>